
#include "Segment.h"

	Segment::Segment(){
	Point newPoint=Point(0,0);
	initial_point=newPoint;
	final_point=newPoint;
	}


	Segment::Segment(Point startPoint, Point finalPoint){
	initial_point= startPoint;
	final_point= finalPoint;
	}

	//class operators
	Segment Segment::operator+(Segment &segment2){
        Point tmp_initial_point;
        Point tmp_final_point;
        tmp_initial_point=initial_point+segment2.initial_point;
        tmp_final_point = final_point+segment2.final_point;

        return Segment(tmp_initial_point, tmp_final_point);
	}

	Segment Segment::operator-(Segment &segment2){
        Point tmp_initial_point;
        Point tmp_final_point;
        tmp_initial_point=initial_point-segment2.initial_point;
        tmp_final_point = final_point-segment2.final_point;

        return Segment(tmp_initial_point, tmp_final_point);
	}


	Segment Segment::operator*(double num)
	{
	  Point tmp_initial_point = initial_point*num;
	  Point tmp_final_point = final_point*num;

	  return Segment(tmp_initial_point, tmp_final_point);
	}

    /*
	void Segment::operator=(Segment &segment2){
	initial_point=segment2.initial_point;
	final_point=segment2.final_point;
	}*/
